-------------------------------------------------------------------------------
--	 File name: shared.lua
--		Author: Sploder
-- 		  Date: 03/10/2010
-- Description: This file contains the definitions shared between the client
--					and the server for Sakuyas's special knives used when the
--					player uses spellcard "Killing Doll."
--
-------------------------------------------------------------------------------


-- Define the entity's spawn info.
ENT.Type			= "anim"
ENT.Base			= "base_entity"
ENT.PrintName		= "DelayedKnife"
ENT.Author			= "Sploder"
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= "For weapon use only"

-------------------------------------------------------------------------------
--	  Function: ENT:Initialize()
-- Description: This function initializes the entity.
-------------------------------------------------------------------------------
function ENT:Initialize()
	if (SERVER)
	then
		local s = 4				-- The "radius" of the object's bounding box.
	
		self.damage	= 6			-- This is the amount of damage the knife will do on impact (after fired).
		self.timer	= CurTime() + 2.5	-- This is the time at which the entity will die and create aimed knives.
		self.normalAngSpeed	= 15		-- This is the normal speed at which the knife spins.
		self.angle	= 0					-- This is the starting angle for the knife. (it spins)
		self.angleSpeed = 15			-- This is the speed at which the knife spins. (degrees per frame)
		self.pPerHit	= 0
		self.pPerKill	= 0
				
		self.Entity:SetModel("models/danmaku/sakuya/knife01.mdl")	-- Set the model.
			
		self.Entity:PhysicsInitSphere(s)										-- Create a ball for collisions.
		self.Entity:SetCollisionBounds(Vector( -s, -s, -s), Vector( s, s, s))	-- Create a bounding box.
		self.Entity:SetMoveType(MOVETYPE_VPHYSICS)	-- Set moving for physics.
		self:SetTrigger(true)
		self:DrawShadow(false)						-- Don't draw shadows for this thing.
		self:SetCollisionGroup(COLLISION_GROUP_WORLD)
	end
end